package fr.afcepf.atod18.fw.controler;

import java.util.HashMap;
import java.util.Map;

import fr.afcepf.atod18.fw.action.ActionConnexion;
import fr.afcepf.atod18.fw.action.ActionIndex;
import fr.afcepf.atod18.fw.action.ActionInscription;
import fr.afcepf.atod18.fw.action.ActionLogout;
import fr.afcepf.atod18.fw.action.IAction;
import fr.afcepf.atod18.fw.form.ConnexionForm;
import fr.afcepf.atod18.fw.form.IndexForm;



public class Factory {


    public Factory() {
        
    }
    
    public IAction done(String provenance, Map params){
        
        Class<IAction> c = (Class<IAction>) params.get(provenance);
        IAction a = null;
        
        try{
            a = (IAction)c.newInstance();
        }
        catch (InstantiationException ie){
            ie.printStackTrace();
        }
        catch (IllegalAccessException e){
            e.printStackTrace();
        }
        
        return a; 
        
    }

//    /**
//     * @return the mapFactory
//     */
//    public Map<String, Class> getMapFactory() {
//        return mapFactory;
//    }
//
//    /**
//     * @param paramMapFactory the mapFactory to set
//     */
//    public void setMapFactory(Map<String, Class> paramMapFactory) {
//        mapFactory = paramMapFactory;
//    }
//    
    
    
}
